Contourf#
Download this notebook from GitHub (right-click to download).
import hvplot.xarray # noqa
Similar to image, contourf displays values on a 2d grid. But it first segments data into various levels.
import xarray as xr
ds = xr.tutorial.open_dataset('air_temperature')
ds
<xarray.Dataset>
Dimensions: (lat: 25, time: 2920, lon: 53)
Coordinates:
* lat (lat) float32 75.0 72.5 70.0 67.5 65.0 ... 25.0 22.5 20.0 17.5 15.0
* lon (lon) float32 200.0 202.5 205.0 207.5 ... 322.5 325.0 327.5 330.0
* time (time) datetime64[ns] 2013-01-01 ... 2014-12-31T18:00:00
Data variables:
air (time, lat, lon) float32 ...
Attributes:
Conventions: COARDS
title: 4x daily NMC reanalysis (1948)
description: Data is from NMC initialized reanalysis\n(4x/day). These a...
platform: Model
references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...ds.hvplot.contourf()
There are lots of options exposed to control the style and contents of the contourf plot:
ds.mean(dim='time').hvplot.contourf(z='air', x='lon', y='lat', levels=20,
clabel='T [K]', label='Mean Air temperature [K]',
cmap='fire')
Geographic Data#
ds.hvplot.contourf(levels=20, geo=True, coastline=True, widget_location='left_top')
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.
Download this notebook from GitHub (right-click to download).